package com.sgb.auction.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.sgb.auction.BR;
import com.sgb.auction.R;
import com.sgb.auction.entity.AuctionRecordEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import java.util.List;

/**
 * Time:2021/11/22
 * AUTHOR:F_Q
 * Description:
 */
public class MyOfferAdapter extends BaseRecycleAdapter<AuctionRecordEntity> {
    public MyOfferAdapter(Context context, List<AuctionRecordEntity> datas) {
        super(context, R.layout.my_offer_items, datas);
    }

    @Override
    public void onBindViewHolder(ItemViewHolder holder, int position) {
        super.onBindViewHolder(holder, position);
        ImageView myofferimv = holder.itemView.findViewById(R.id.my_offer_imv);
        TextView myofferprice = holder.itemView.findViewById(R.id.my_offer_price);
        TextView myoffertime = holder.itemView.findViewById(R.id.my_offer_time);
        if (position == 0){
            myofferimv.setImageResource(R.mipmap.icon_chujia_red);
            myofferprice.setTextColor(context.getResources().getColor(R.color.color_secondary_orange_eight));
            myoffertime.setTextColor(context.getResources().getColor(R.color.color_secondary_orange_eight));
        }else {
            myofferimv.setImageResource(R.mipmap.icon_chujia_gray);
            myofferprice.setTextColor(context.getResources().getColor(R.color.color_tab_two));
            myoffertime.setTextColor(context.getResources().getColor(R.color.color_tab_two));
        }
    }

    @Override
    public void convert(ItemViewHolder holder, AuctionRecordEntity entity) {
        holder.setBinding(BR.viewModel, entity);
    }
}
